home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectPlay / DataRelay / modDplay.bas < prev    next >
BASIC Source File  |  2001-10-08  |  1KB  |  51 lines

  1. Attribute VB_Name = "modDplay"
  2. Option Explicit
  3. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  4. '
  5. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  6. '
  7. '  File:       modDplay.bas
  8. '
  9. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  10. 'Sleep declare
  11. Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
  12.  
  13. Public Enum vbDplayDataRelayMsgType
  14.     MSG_GamePacket
  15.     MSG_PacketReceive
  16. End Enum
  17.  
  18. 'Constants
  19. Public Const AppGuid = "{0A947595-45D1-48f0-AEE2-E7CF851A1EEE}"
  20.  
  21. Public dx As DirectX8
  22. Public dpp As DirectPlay8Peer
  23.  
  24. 'App specific variables
  25. Public gsUserName As String
  26. 'Our connection form and message pump
  27. Public DPlayEventsForm As DPlayConnect
  28.  
  29. Public Sub InitDPlay()
  30.     'Create our DX/DirectPlay objects
  31.     Set dx = New DirectX8
  32.     Set dpp = dx.DirectPlayPeerCreate
  33. End Sub
  34.  
  35. Public Sub Cleanup()
  36.     If Not (DPlayEventsForm Is Nothing) Then
  37.         'Get rid of our message pump
  38.         DPlayEventsForm.GoUnload
  39.         dpp.UnRegisterMessageHandler
  40.         'Close down our session
  41.         DPlayEventsForm.DoSleep 50
  42.         If Not (dpp Is Nothing) Then dpp.Close
  43.         'Lose references to peer and dx objects
  44.         Set dpp = Nothing
  45.         Set dx = Nothing
  46.     End If
  47. End Sub
  48.  
  49.  
  50.  
  51.